﻿using System;
using System.Collections.Generic;

using Model;
using Model.Components;
using FrameWork.Components;

namespace FrameWork.web.Web
{
    public partial class List : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindDataList();
            }
        }

        private void BindDataList()
        {
            QueryParam qp = new QueryParam();
            qp.Where = " where XIF='已办结'";
            qp.PageIndex = AspNetPager1.CurrentPageIndex;
            qp.PageSize = AspNetPager1.PageSize;
             
            int RecordCount = 0;
            List<T_WebEntity> lst = BusinessFacadeModel.T_WebList(qp, out RecordCount);
            GridView1.DataSource = lst;
            GridView1.DataBind();
            this.AspNetPager1.RecordCount = RecordCount;
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            QueryParam qp = new QueryParam();
            string id = TextBox1.Text.ToString();

            qp.Where = string.Format(" where TID like '%{0}%'    ", id);
            qp.PageIndex = AspNetPager1.CurrentPageIndex;
            qp.PageSize = AspNetPager1.PageSize;

            int RecordCount = 0;
            List<T_WebEntity> lst = BusinessFacadeModel.T_WebList(qp, out RecordCount);
            GridView1.DataSource = lst;
            GridView1.DataBind();
            this.AspNetPager1.RecordCount = RecordCount;
        }
        public string Get_U_GroupID(int U_GroupID)
        {
            return BusinessFacade.sys_GroupDisp(U_GroupID).G_CName;
        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindDataList();
        }
        
    }
}